home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_00_cyn_opening.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  311 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 00_CYN_Opening.cog
  4. #
  5. # Main Title & Indy goes to work...
  6. #
  7. # [HB] [CMG] [RT]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        user0
  19.  
  20. # .................................. KEYFRAMES .................................
  21.  
  22.     keyframe    in_handsOnHips=0in_stand4.key            local
  23.     keyframe    in_hatPush=0in_figithat_4_4.key            local
  24.  
  25. # ................................. MATERIALS ..................................
  26.  
  27.     material    topMat=pyr_jeep_top.mat                    local
  28.     material    botMat=pyr_jeep_bbmp.mat                local
  29.  
  30. # .................................. SOUNDS ....................................
  31.  
  32.     sound       in_gotowork=Cn01j01.wav                    local
  33.     sound        mus_intro=mus_cyn_intro.WAV                local
  34.  
  35. # ............................... ACTOR THINGS .................................
  36.  
  37.     thing        player                                    local
  38.     thing        indy                                    linkid=0
  39.  
  40. # .............................. OBJECT THINGS .................................
  41.  
  42.     thing        fadeplate                                nolink
  43.     thing        fadeplate1                                nolink
  44.     thing        fadeplate2                                nolink
  45.     thing        maintitle                                nolink
  46.     thing        placetime                                nolink
  47.  
  48. # .............................. CAMERA THINGS .................................
  49.  
  50.     thing        cam_1                                    nolink
  51.  
  52.     thing        ct_1                                    nolink
  53.     thing        ct_2                                    nolink
  54.     thing        dummytarget                                nolink
  55.  
  56. # .............................. TARGET THINGS .................................
  57.  
  58.     thing        in_mk_1                                    nolink
  59.     thing        in_mk_2                                    nolink
  60.     thing        in_mk_3                                    nolink
  61.     thing        in_mk_4                                    nolink
  62.  
  63. # ............................... 3DOs TO BE HIDDEN @ STARTUP ..................
  64.     thing        object0
  65.     thing        object1
  66.     thing        object2
  67.     thing        object3
  68.     thing        object4
  69.     thing        object5
  70.     thing        object6
  71.     thing        object7
  72.     thing        object8
  73.     thing        object9
  74.     thing        object10
  75.     thing        object11
  76.     thing        object12
  77.     thing        object13
  78.     thing        object14
  79.     thing        object15
  80.     thing        object16
  81.     thing        object17
  82.     thing        object18
  83.     thing        object19
  84.     thing        object20
  85.     thing        object21
  86.     thing        object22
  87.     thing        object23
  88.     thing        object24
  89.     thing        object25
  90.     thing        object26
  91.     thing        object27
  92.     thing        object28
  93.     thing        object29
  94.     thing        object30
  95.     thing        object31
  96.     thing        object32
  97.     thing        object33
  98.     thing        object34
  99.     thing        object35
  100.     thing        object36
  101.     thing        object37
  102.     thing        object38
  103.     thing        object39
  104.     thing        object40
  105.     thing        object41
  106.     thing        object42
  107.     thing        object43
  108.     thing        object44
  109.     thing        object45
  110.     thing        object46
  111.     thing        object47
  112.  
  113.  
  114. # ............................... VARIABLES ....................................
  115.  
  116.     vector        v_camspot                                local
  117.  
  118.     int            pl_colltype                                local
  119.  
  120.     int            in_keyTrack1                            local
  121.     int            in_keyTrack2                            local
  122.             
  123.     int            cursound                                local
  124.  
  125.     int            bSeen=0                                    local
  126.     
  127.     int            i_hide3d0=0                                local
  128.  
  129. end
  130.  
  131. # ==============================================================================
  132.  
  133. code
  134.  
  135. # ..............................................................................
  136.  
  137. startup:
  138.  
  139.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  140.  
  141.     Sleep(0.001); # Let engine get set up
  142.  
  143.     # Prep titles...
  144.     SetThingAlpha(fadeplate, 1.0);
  145.     SetThingAlpha(fadeplate1, 1.0);
  146.     SetThingAlpha(fadeplate2, 1.0);
  147.     SetThingAlpha(maintitle, 0.0);
  148.     SetThingAlpha(placetime, 0.0);
  149.  
  150.     # Start on black...
  151.     SetCameraLookInterp(2, 0);
  152.     SetCameraPosInterp(2, 0);
  153.     SetCameraFocus(2, cam_1);
  154.     SetCameraSecondaryFocus(2, ct_1);
  155.     SetCurrentCamera(2);
  156.     SetCameraFOV(25, 0, 0);
  157.  
  158.     return;
  159.  
  160. # ..............................................................................
  161.  
  162. user0: # RT: Indicates that autosave/restore has completed...
  163.  
  164.     if (bSeen) return; # RT
  165.     bSeen = 1;
  166.  
  167.     player = GetLocalPlayerThing();
  168.  
  169.     # Start on black...
  170.     SetCameraLookInterp(2, 0);
  171.     SetCameraPosInterp(2, 0);
  172.     SetCameraFocus(2, cam_1);
  173.     
  174.     # a frame looking at the base of the canyon to force texture load
  175.     SetCameraSecondaryFocus(2, dummytarget);
  176.     Sleep(0.1);
  177.  
  178.     # hide all the 3dos
  179.     for (i_hide3d0 = 0; i_hide3d0 <= 47; i_hide3d0 = i_hide3d0 + 1) 
  180.     {
  181.         SetThingFlags(object0[i_hide3d0], 0x80000);
  182.     }
  183.  
  184.     SetCameraSecondaryFocus(2, ct_1);
  185.     SetCurrentCamera(2);
  186.     SetCameraFOV(25, 0, 0);
  187.     pl_colltype = GetCollideType(player);
  188.     SetCollideType(player, 0);
  189.     SetActorFlags(player, 0x200000);
  190.     SetThingFlags(player, 0x10); # here but invisible 
  191.  
  192.     # RT: Set up jeep materials
  193.     SetMaterialCel(topMat, 1);
  194.     SetMaterialCel(botMat, 1);
  195.  
  196.     Sleep(0.5); # Let engine generate a frame now
  197.  
  198.     StartCutScene(2);
  199.  
  200.     # Prep actor...
  201.     AISetCutSceneMode(indy);
  202.     CopyPlayerHolsters(player, indy);
  203.     ClearThingFlags(indy, 0x80000);
  204.  
  205.     # Play music...
  206.     PlaySoundLocal(mus_intro, 1.0, 0.0, 0x0, 0);
  207.     Sleep(1.0);
  208.  
  209.     # Fade in sky...
  210.     ThingFadeAnim(fadeplate, 1.0, 0.0, 1.0, 0);
  211.     ThingFadeAnim(fadeplate1, 1.0, 0.0, 1.0, 0);
  212.     ThingFadeAnim(fadeplate2, 1.0, 0.0, 1.0, 0);
  213.  
  214.     # Fade in main title...
  215.     ThingFadeAnim(maintitle, 0.0, 1.0, 1.0, 0);
  216.  
  217.     # Prep camera position...
  218.     v_camspot = GetThingPos(in_mk_4);
  219.     SetCameraPosition(1, v_camspot);
  220.     Sleep(4.0);
  221.  
  222.     # Fade title out...
  223.     ThingFadeAnim(maintitle, 1.0, 0.0, 0.5, 0);
  224.     Sleep(0.5);
  225.  
  226.     # TO DO: make sure the birds are flying
  227.  
  228.     # Prep camera...
  229.     SetCameraInterpSpeed(2, 6.0);
  230.     SetCameraLookInterp(2, 1);
  231.     SetCameraPosInterp(2, 1);
  232.     Sleep(0.1);
  233.  
  234.     # Tilt down to canyon...
  235.     SetCameraSecondaryFocus(2, ct_2);
  236.     SetCameraFOV(85, 1, 6.0);
  237.     Sleep(6.0);
  238.  
  239.     # Fade in place & time notice...
  240.     ThingFadeAnim(placetime, 0.0, 1.0, 0.5, 0);
  241.     Sleep(3.0);
  242.  
  243.     # Clear notice...
  244.     ThingFadeAnim(placetime, 1.0, 0.0, 0.5, 0);
  245.  
  246.     # Bring Indy on stage...
  247.     TeleportThing(indy, in_mk_1);
  248.     AISetMoveSpeed(indy, 1.0);
  249.     AISetLookThing(indy, in_mk_2);
  250.     AISetMoveThing(indy, in_mk_2, 0);
  251.     AIWaitForStop(indy);
  252.     AISetLookThing(indy, in_mk_4);
  253.  
  254.     # Indy: "Time to go to work."
  255.     in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x10, 0);
  256.     in_keyTrack2 = PlayKey(indy, in_hatPush, 4, 0x12, 0);
  257.     Sleep(0.8);
  258.     cursound = PlayVoice(indy, in_gotowork, 1.0, 0);
  259.     Sleep(0.7);
  260.     StopKey(indy, in_keyTrack1, 0.5);
  261.     StopKey(indy, in_keyTrack2, 0.5);
  262.     Sleep(0.5);
  263.     WaitForSound(cursound);
  264.  
  265.     # Indy slides...
  266.     AISetMoveSpeed(indy, 1.5); # push him over edge
  267.     AISetMoveThing(indy, in_mk_3, 1);
  268.     AISetMoveSpeed(indy, 1.0);
  269.     AISetLookThing(indy, player);
  270.     AISetMoveThing(indy, player, 0);
  271.     AIWaitForStop(indy);
  272.     Sleep(0.5);
  273.  
  274.     # Clean up & hand over control to player...
  275.     DestroyThing(fadeplate);
  276.     DestroyThing(fadeplate1);
  277.     DestroyThing(fadeplate2);
  278.     DestroyThing(maintitle);
  279.     DestroyThing(placetime);
  280.  
  281.     # Slam player into place...
  282.     TeleportThing(player, indy);
  283.     Sleep(0.01);
  284.  
  285.     SetThingFlags(indy, 0x80000);
  286.     ClearThingFlags(player, 0x10); # visible
  287.     SetCollideType(player, pl_colltype);
  288.  
  289.     ResetCameraFOV(0, 0.0);
  290.     SetCameraLookInterp(2, 0);
  291.     SetCameraPosInterp(2, 0);    
  292.  
  293.     SetCurrentCamera(1);
  294.     
  295.     # show all the 3dos
  296.     for (i_hide3d0 = 0; i_hide3d0 <= 47; i_hide3d0 = i_hide3d0 + 1) 
  297.     {
  298.         ClearThingFlags(object0[i_hide3d0], 0x80000);
  299.     }
  300.     
  301.     EndCutScene();
  302.     ClearActorFlags(player, 0x200000);
  303.  
  304.     # RT: Give 'im a snake bite kit...
  305.     SetInv(player, 46, 1);
  306.     SetInvAvailable(player, 46, 1);
  307.  
  308.     return;
  309.  
  310. end
  311.